﻿@model TYAJZWeb.Models.ProjectBeiAnPrintModel
@{
    ViewBag.Title = "打印备案情况";
}
@section CSS{
    <link href="@Url.Content("~/Content/PrintEquipmentBeiAnExternal.css")" rel="stylesheet" type="text/css" />
}
@section BodyNav
{
    > @Html.ActionLink("工程列表", "List", "Project") > 打印备案情况
}
@section JS
{
    <script src="@Url.Content("~/Scripts/LodopFuncs.js")" type="text/javascript"></script>
    <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
        height="0">
        <param name="Border" value="0">
        <embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0"></embed>
    </object>
    <script type="text/javascript">
        var LODOP; //声明为全局变量 
        var topIndex=0;
        function prn1_preview() {
            LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
            LODOP.SET_PRINTER_INDEX(@Model.PrinterId);
            LODOP.SET_PRINT_PAGESIZE(1,'17.6cm','25.5cm','beian');
            LODOP.SET_PRINT_MODE("POS_BASEON_PAPER",true);
           LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW',1);
           
           if(confirm("打印页面上半部分？")==false)
           {
           topIndex=450;
           }
            CreateOneFormPage();
            LODOP.PREVIEW();
            topIndex=0;

            //LODOP.PRINT_DESIGN();
        };
        function CreateOneFormPage() {
            $('div.print').each(function()
            {
                LODOP.ADD_PRINT_TEXT(parseInt($(this).attr('top'))+topIndex,$(this).attr('left'),$(this).attr('width'),$(this).attr('height'),$(this).html());
            });
        };
    </script>
}
<h1>
    打印《备案情况》</h1>
<table class="edit">
    <tr>
        <td>
            <div id="dvBeiAnExternal">
                <div id="dvAddress" class="print" top="85" left="125" width="227" height="40">@Model.Address</div>
                <div id="dvName" class="print" top="85" left="465" width="175" height="40">@Model.Name</div>
                <div class="ClearBoth"></div>
                <div id="dvDemolition" class="print" top="125" left="125" width="135" height="40">@Model.DemolitionCompany</div>
                <div id="dvDemolitionOwner" class="print" top="125" left="376" width="74" height="40">@Model.DemolitionCompanyOwner</div>
                <div id="dvConstructDateTime" class="print" top="125" left="550" width="100" height="40">@Model.ConstructDateTime</div>
                <div class="ClearBoth"></div>
                <div id="dvConstruction" class="print" top="176" left="125" width="135" height="40">@Model.ConstructionCompany</div>
                <div id="dvConstructionOwner" class="print" top="176" left="376" width="74" height="40">@Model.ConstructionProjectManager</div>
                <div id="dvConstructionOwnerPhone" class="print" top="176" left="550" width="79" height="40">@Model.ConstructionProjectManagerPhoneMobile</div>
                <div class="ClearBoth">
                </div>
                <div id="dvInspectCompany" class="print" top="225" left="125" width="135" height="40">@Model.InspectCompany</div>
                <div id="dvInspectTime" class="print" top="225" left="376" width="100" height="40">@Model.InspectTime</div>
                <div id="dvInspectResult" class="print" top="225" left="550" width="79" height="40">@Model.InspectResultValue</div>
                <div id="dvAJZName" class="print" top="266" left="254" width="324" height="40">@Model.AJZName</div>
                <div id="dvTime" class="print" top="311" left="254" width="324" height="40">@Model.RegisterDate.ToString("yyyy年MM月dd日")</div>
            </div>
        </td>
    </tr>
    <tr>
        <td>
            <input type="button" value="打印" class="btnBtn" onclick="prn1_preview()" />
            @Html.ActionLink("返回工程", "Detail", "Project", new { Id = Model.Id }, new { @class = "lnkBtn" })
            @Html.ActionLink("返回列表", "List", "Project", null, new { @class = "lnkBtn" })
        </td>
    </tr>
</table>
